#ifndef PLATFORM_H
#define PLATFORM_H

#include "Rect.h"
#include "Sprite.h"
#include "Stair.h"
#include <list>
#include "AnimatorHolder.h"
#include "FrameRangeAnimation.h"
#include "SpinachBox.h"

class Platform {
private:
	typedef std::list<Stair*> StairList;
	StairList goingUp, goingDown;
	std::list<SpinachBox*> spinachBoxList;
	Rect rect;
	bool left_open, right_open;
public:
	Platform(const Rect &_rect, bool _left, bool _right): 
	  rect(_rect), left_open(_left), right_open(_right) { };
	~Platform(void);

	const Rect GetRect(void) const { return rect; };
	void addGoingUpStair(Stair *up);
	void addGoingDownStair(Stair *down);
	void addSpinachBox(SpinachBox *box);
	void AlignWithPlatform(Sprite* s);
	Stair* CollidesWithGoingUpStair(Sprite* s);
	Stair* CollidesWithGoingDownStair(Sprite* s);
	SpinachBox *CollidesWithSpinachBox(Sprite *s, int dx);
	bool CollidesWithEdge(Sprite *s, int dx);
	bool CollidesWithSea(Sprite *s);
};

#endif
